﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MES.Desktop.Entities
{
    // 客户端接收服务端数据后，做反序列化时的结构
    /// <summary>
    /// Api返回数据的时候，统一格式
    /// 1. 方便前端调用访问数据
    /// 2. 如果服务器发生了错误、异常之后，也是给包装成ApiResult返回
    /// </summary>
    public class ApiResult
    {
        /// <summary>
        /// 是否正常返回---状态
        /// </summary>
        public bool Success { get; set; } = true;

        /// <summary>
        /// 处理消息
        /// </summary>
        public string? Message { get; set; } = "Success";
    }


    public class ApiDataResult<T> : ApiResult
    {
        /// <summary>
        /// 结果集
        /// </summary>
        public T? Data { get; set; }

        /// <summary>
        /// 冗余结果
        /// </summary>
        public object? OValue { get; set; } = 200;
    }
}
